var o, e = require,
    t = module,
    n = exports,
    i = this && this.__extends || (o = function(t, e) {
        return (o = Object.setPrototypeOf || {
                __proto__: []
            }
            instanceof Array && function(t, e) {
                t.__proto__ = e;
            } || function(t, e) {
                for (var n in e) e.hasOwnProperty(n) && (t[n] = e[n]);
            })(t, e);
    }, function(t, e) {
        function n() {
            this.constructor = t;
        }
        o(t, e), t.prototype = null === e ? Object.create(e) : (n.prototype = e.prototype,
            new n());
    }),
    a = this && this.__decorate || function(t, e, n, a) {
        var o, c = arguments.length,
            i = c < 3 ? e : null === a ? a = Object.getOwnPropertyDescriptor(e, n) : a;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) i = Reflect.decorate(t, e, n, a);
        else
            for (var r = t.length - 1; 0 <= r; r--)(o = t[r]) && (i = (c < 3 ? o(i) : 3 < c ? o(e, n, i) : o(e, n)) || i);
        return 3 < c && i && Object.defineProperty(e, n, i), i;
    };

Object.defineProperty(n, "__esModule", {
    value: !0
});

var r = e("PrefabView"),
    s = e("MatchView"),
    c = e("GameManager"),
    l = e("BattleView"),
    d = cc._decorator,
    u = d.ccclass,
    p = d.property,
    h = function(e) {
        function t() {
            var t = null !== e && e.apply(this, arguments) || this;
            return t.matchView = null, t.battleView = null, t.gameViewPrefab = null, t;
        }
        return i(t, e), t.prototype.onLoad = function() {},
            t.prototype.start = function() {
                var t = this;
                c.default.getInstance().matchType == c.MatchType.正常 || c.default.getInstance().matchType == c.MatchType.引导 ? (this.matchView.node.active = !0,
                    this.matchView.init(c.default.getInstance().aicount, c.default.getInstance().jsonPath, function() {
                        t.init();
                    })) : c.default.getInstance().matchType == c.MatchType.三对三 && (this.battleView.node.active = !0,
                    this.battleView.init(c.default.getInstance().aicount, function() {
                        t.init();
                    }));
            },
            t.prototype.init = function() {
                var t = cc.instantiate(this.gameViewPrefab);
                t.parent = this.node, c.default.getInstance().gameView = t.getComponent("GameView")
                c.default.getInstance().gameView.load();
            },
            a([p(s.default)], t.prototype, "matchView", void 0),
            a([p(l.default)], t.prototype, "battleView", void 0),
            a([p(cc.Prefab)], t.prototype, "gameViewPrefab", void 0), a([u], t);
    }(r.default);

n.default = h;